home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / IFF / IFF_Forms / FANT.doc < prev    next >
Encoding:
Text File  |  1993-03-01  |  9.4 KB  |  234 lines

  1. Fantavision movie format
  2.  
  3. FORM FANT
  4.  
  5. /*********************************************************************/
  6. /*                                                                   **
  7. ** - FantForm.h                                                      **
  8. **                                                                   **
  9. **     This is the IFF movie format for Amiga Fantavision.           **
  10. **                                                                   **
  11. **     (c) Copyright 1988 Broderbund Software                        **
  12. **                                                                   **
  13. **     - FORMAT FROZED May 5, 1988 -                                 **
  14. **                                                                   **
  15. **     Implemented by Steve Hales                                    **
  16. **                                                                   **
  17. ** Overvue -                                                         **
  18. **     This is a description of the format used for Amiga            **
  19. **     Fantavision.  It assumes you have intimate knowledge of how   **
  20. **     IFF-FORMs are constructed, layed out, and read.  This file    **
  21. **     can be used as a header file.  This is fairly complete, but   **
  22. **     I'm sure there are a few things missing.                      **
  23. **                                                                   **
  24. **     I can be reached in the following ways:                       **
  25. **       UseNet:   Steve_A_Hales@cup.portal.com  OR                  **
  26. **                 sun!cup.portal.com!Steve_A_Hales                  **
  27. **                                                                   **
  28. **       US Mail:  882 Hagemann Drive                                **
  29. **                 Livermore, CA, 94550-2420                         **
  30. **                                                                   **
  31. **       Phone:    (415) 449-5297                                    **
  32. **                                                                   **
  33. **     NOTE:  I cannot, by contract, give out any code to load or    **
  34. **            play Fantavision movies.  If that is want you want     **
  35. **            then you will need to contact Broderbund Software      **
  36. **            directly.  Their number is (415) 492-3200.             **
  37. **                                                                   **
  38. ** Enjoy!  Aloha.                                                    **
  39. **                                                                   */
  40. /*********************************************************************/
  41.  
  42. /* Misc Fantavision structures
  43. */
  44. typedef struct Rect
  45. {
  46.    int left, top, right, bottom;
  47. };
  48. typedef struct Point
  49. {
  50.    int h, v;
  51. };
  52.  
  53. /* Frame opcodes */
  54. #define opNEXT     0       /* go on to next frame */
  55. #define opREPEAT   1       /* repeat sequence starting from frame Parm rep1 times */
  56. #define opGOTO     2       /* goto frame Parm */
  57.  
  58. /* Frame modes */
  59. #define fNORMAL    0x0000  /* redraw every frame */
  60. #define fTRACE     0x0001  /* draw into both paged screens */
  61. #define fLIGHTNING 0x0020  /* don't erase background */
  62.  
  63.  
  64. /* Fantavision FORM defines
  65. */
  66. #define ID_FANT    'FANT'          /* FORM type */
  67. #define ID_FHDR    'FHDR'          /* Movie Header */
  68. #define ID_FRAM    'FRAM'          /* Format info for a Frame */
  69. #define ID_POLY    'POLY'          /* Format info for a Polygon */
  70. #define ID_CSTR    'CSTR'          /* \0 terminated string */
  71.  
  72. /* Polygon modes */
  73. #define pTYPEMASK  0x00FF      /* type mask to get just type of poly */
  74. #define pSELECT    0x8000      /* is object selected? */
  75. #define pOUTLINE   0x4000      /* outlined polygon using DotModeSide to
  76.                                ** determine when to not connect a line.
  77.                                ** ex. 0 draws on all sides, 1 will draw on
  78.                                ** everyother side, 2 will leave every second
  79.                                ** side blank, 3 will every third side
  80.                                ** blank, etc. */
  81. #define pBACKDROP  0x2000      /* polygon will be dropped into the background
  82.                                ** during animation. */
  83. #define pMSKBITMAP 0x1000      /* bitmap has a mask */
  84.  
  85. /* Polygon types */
  86. #define pDELETE    0x7000      /* object is a filler (its deleted from display) */
  87. #define pFILLED    0           /* filled polygon */
  88. #define pLINE      1           /* not-connected line polygon */
  89. #define pLINED     2           /* connected line polygon */
  90. #define pTEXTBLOCK 3           /* text block to draw */
  91. #define pCIRCLEDOT 4           /* draw circle dots at vertex's using
  92.                                ** dotSize at size. */
  93. #define pRECTDOT   5           /* draw square dots at vertex's using
  94.                                ** dotSize at size. */
  95. #define pBITMAPDOT 6           /* draw dots using a bitmap at vertex's using
  96.                                ** BitMap. */
  97. #define pBITMAP    7           /* draw just bitmap image */
  98.  
  99. /* These are used for the pTEXTBLOCK polygon type
  100. */
  101. /* Text justification
  102. */
  103. #define tLEFT      0
  104. #define tCENTER    1
  105. #define tRIGHT     2
  106. /* Text style
  107. */
  108. #define tNORMAL    (int)(FS_NORMAL)
  109. #define tBOLD      (int)(FSF_BOLD)
  110. #define tITALIC    (int)(FSF_ITALIC)
  111. #define tUNDERLINE (int)(FSF_UNDERLINED)
  112. #define tEXTENDED  (int)(FSF_EXTENDED)
  113.  
  114.  
  115.  
  116.  
  117. /* Fantavision movie header -
  118. **
  119. **     This header defines how much RAM is needed, how many frames, and sounds
  120. **     in the movie.
  121. */
  122. typedef struct FantHeader
  123. {
  124.    int PointsPerObj;       /* number of vertexs per object */
  125.    int ObjsPerFrame;       /* number of objects per frame */
  126.    int ScreenDepth;        /* 0 to 6, for number of bit planes */
  127.    int ScreenWidth;        /* in pixels */
  128.    int ScreenHeight;       /* in pixels */
  129.    int BackColor;          /* background color palette number */
  130.    long SizeOfMovie;       /* RAM Size of movie, expanded */
  131.    int pad[30];            /* padding for expanding */
  132.    int NumberOfFrames;
  133.    int NumberOfSounds;
  134.    int NumberOfBitMaps;
  135.    int Background;         /* non-zero if first bitmap is a background */
  136.    int SpeedOfMovie;       /* 100 is normal speed, 50 is half speed, etc */
  137.    int pad[3];             /* expansion */
  138. };
  139.  
  140. /* Fantavision frame info -
  141. **
  142. **     Each frame has this structure defined.
  143. */
  144. typedef struct FrameFormat
  145. {
  146.    int OpCode;                 /* Frame opcode */
  147.    long Parm;                  /* contains frame number for opNEXT, opREPEAT */
  148.    char Rep1, Rep2;            /* Rep1 is repeat counter, Rep2 is not used */
  149.    int TweenRate;              /* number of tweens per frame */
  150.  
  151.    int ChannelIndex[2];        /* -3 stop sound is this channel
  152.                                ** -2 modify current sound
  153.                                ** -1 no sound for this channel
  154.                                ** (all others) is an index into the sound
  155.                                ** list.  Which sound to use.
  156.                                */
  157.  
  158.    int NumberOfPolys;          /* number of polygons in this frame */
  159.    int ColorPalette[32];       /* xRGB - format 4 bits per register */
  160.    int Pan, Tilt;              /* 0 is centered, (+-) amounts are in pixels */
  161.    int Modes;                  /* Frame modes */
  162.    int pad;                    /* expansion */
  163. };
  164.  
  165. /* Fantavision polygon info -
  166. **
  167. **     Each polygon has this structure defined.
  168. */
  169. typedef struct PolyFormat
  170. {
  171.    int NumberOfPoints;         /* how many vertexs for this polygon */
  172.    int Type;                   /* polygon type */
  173.    int Color;                  /* palette color number (see note 1) */
  174.    Rect Bounds;                /* enclosing rectangle of polygon */
  175.    int Depth;                  /* polygon view depth (see note 2) */
  176.    char DotModeSize;           /* in pixels, not larger than 40 */
  177.    char DotModeSide;           /* determines outlining features */
  178.    int OutlineColor;           /* palette color number for outline */
  179.    int BitMapIndex;            /* if not -1, then bitmap index into bitmap list */
  180.    int BMRealWidth;            /* in pixels */
  181.    int BMRealHeight;
  182.    int TextLength;             /* length of text for pTEXTBLOCK */
  183.    int TextJust;
  184.    char TextSize;              /* size in pixels */
  185.    char TextStyle;
  186.    long pad;                   /* expansion */
  187.    Point p[];                  /* array of points defining vertexs */
  188. };
  189.  
  190. /* Fantavision high-level IFF format.
  191. **
  192.    FORM FANT
  193.        FHDR
  194.  
  195.        - background -
  196.        FORM ILBM   if Background is non-zero
  197.            BMHD
  198.            BODY
  199.  
  200.        - bitmap list -
  201.        NOTE:  If a bitmap has a mask, it will be compute during load time.
  202.  
  203.        FORM ILBM   times NumberOfBitMaps
  204.            BMHD
  205.            BODY
  206.  
  207.        - sound list -
  208.    {   FORM 8SVX   times NumberOfSounds
  209.            VHDR
  210.            BODY
  211.        SEFX    }   Default parameters for sound
  212.  
  213.        - frame list -
  214.    {   FRAM        times NumberOfFrames
  215.        SEFX        if sound for channel 1.
  216.        SEFX        if sound for channel 2.
  217.        POLY        times NumberOfPolys
  218.      { CSTR        Text of poly if PolyType = pTEXTBLOCK
  219.        CSTR  } }   Name of font
  220. */
  221.  
  222. /******- NOTES -**********************************************************/
  223. /*
  224. ** 1 - The color palette is a number from 0 to 1120.  The first 32 numbers
  225. **     are normal RGB colors, but the rest index into a pre-defined
  226. **     set of patterns.
  227. **
  228. ** 2 - The view depth of each polygon determines the display order.  The
  229. **     higher the number the closer the polygon is to the viewer.  During
  230. **     editing, each polygon is assigned numbers in multiplies of 100,
  231. **     but to function, any number can work.
  232. */
  233.  
  234.